package com.linq.cool.beauty.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.linq.cool.common.core.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @Author: yqlin
 * @Date: 2021/2/7 03:22
 * @Description: 优惠券表
 * @Version: 1.0.0
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "beauty_coupon")
public class BeautyCoupon extends BaseEntity {
    /**
     * 卡券id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(value = "id", type = IdType.INPUT)
    private Long id;

    /**
     * 使用类型(0: 全场通用 1:指定分类 2:指定商品)
     */
    @TableField(value = "`type`")
    private Integer type;

    /**
     * 优惠券名称
     */
    @TableField(value = "`name`")
    private String name;

    /**
     * 金额
     */
    @TableField(value = "amount")
    private BigDecimal amount;

    /**
     * 订单金额达到多少时候才可以使用
     */
    @TableField(value = "min_point")
    private BigDecimal minPoint;

    /**
     * 有效时间起
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @TableField(value = "start_time")
    private Date startTime;

    /**
     * 有效时间止
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @TableField(value = "end_time")
    private Date endTime;

    /**
     * 剩余数量
     */
    @TableField(value = "remain_count")
    private Integer remainCount;

    /**
     * 发行数量
     */
    @TableField(value = "publish_count")
    private Integer publishCount;

    /**
     * 已使用数量
     */
    @TableField(value = "use_count")
    private Integer useCount;

    /**
     * 领取数量
     */
    @TableField(value = "receive_count")
    private Integer receiveCount;

    /**
     * 是否删除(0: 未删除 1:已删除)
     */
    @TableLogic
    @TableField(value = "is_deleted")
    private Integer isDeleted;

    /**
     * 状态(0: 已过期 1:正常)
     */
    @TableField(value = "`status`")
    private Integer status;

}